package cn.wegoteam.shop.po;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import cn.wegoteam.shop.enu.NewsType;
import cn.wegoteam.shop.enu.YesOrNo;

/**
 * News entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "news", catalog = "shop")
public class News extends BasePo implements java.io.Serializable {

	private static final long serialVersionUID = 7226448984101362495L;
	private Integer id;// 新闻id
	private String title;// 新闻标题
	private String content;// 新闻内容
	private String date;// 新闻添加时间
	private Integer click;// 新闻点击量
	private String imgUrl;// 新闻图片
	private NewsType type;// 新闻类型
	private Integer flag;// 新闻标志位
	//联系我们等
	private String tag;
	//是否显示广告
	private YesOrNo advert;
	// Constructors

	/** default constructor */
	public News() {
	}
	public News(Integer id) {
		this.id=id;
	}

	
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "title", nullable = false, length = 100)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	@Column(name = "tag",length = 10)
	public String getTag() {
		return this.tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	@Column(name = "content", nullable = false, length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "date", nullable = false, length = 20)
	public String getDate() {
		return this.date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	@Column(name = "click", nullable = false,insertable=false)
	public Integer getClick() {
		return this.click;
	}

	public void setClick(Integer click) {
		this.click = click;
	}

	@Column(name = "imgUrl", length = 200)
	public String getImgUrl() {
		return this.imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	@Column(name = "type", nullable = false, length = 10)
	@Enumerated(EnumType.STRING)
	public NewsType getType() {
		return this.type;
	}

	public void setType(NewsType type) {
		this.type = type;
	}
	@Column(name = "advert", length = 10)
	@Enumerated(EnumType.STRING)
	public YesOrNo getAdvert() {
		return this.advert;
	}

	public void setAdvert(YesOrNo advert) {
		this.advert = advert;
	}

	@Column(name = "flag", nullable = false)
	public Integer getFlag() {
		return this.flag;
	}

	public void setFlag(Integer flag) {
		this.flag = flag;
	}

}